Secure RESTful Web Services Application Sample Project with Apache Shiro 1.2.3, Jersey 1.18.1 and Google Guice 3.0
- Servlet 2.5
- Jersey 1.18.1
- Guice 3.0
- Apache Shiro 1.2.3
- guice-persist 3.0
- gson 2.2.4
- joda-time 2.4
- JUnit 4.10
- Java 7
- Maven 3
- Tomcat 7
- Make the war file
mvn clean package
- Deploy the war file in Tomcat 7 with Eclipse or manually
- The REST WS are accessible under /rest/*
- Front-End not yet implemented.
- Generate an archetype:
mvn archetype:create-from-project
- Go to
target/generated-sources/archetype
and runmvn install
- Create a fresh project from Archetype
mvn archetype:generate -DarchetypeCatalog=local
usingcom.pampanet:secure-rest-webapp-archetype
- You can select the archetype from Eclipse IDE from the "New Maven Project" Wizard
- Shiro's Default Filters: http://shiro.apache.org/web.html#Web-DefaultFilters
- In
com.pampanet.sample.shiro.modules.BootstrapShiroModule
are all the filters, placed in order. - You can replace
com.pampanet.sample.shiro.modules.ShiroAnnotationsModule
with Shiro's defaultShiroAopModule
class.
- Sample
shiro.ini
file insrc/main/resources
- To configure more Realms and Filters, refer to Shiro's Documentation https://shiro.apache.org/static/current/apidocs/org/apache/shiro/realm/Realm.html